package org.demo.ioc.pc;

import java.util.logging.Logger;

import org.apache.log4j.PropertyConfigurator;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class ClientDemo {
	static Logger logger = Logger.getLogger(ClientDemo.class.toString());

	public static void main(String[] args) {

		PropertyConfigurator.configure("log4j.properties");

		ClassPathResource res = new ClassPathResource("computer-bean.xml");

		BeanFactory factory = new XmlBeanFactory(res);

		Computer computer = (Computer) factory.getBean("myComputer");

		computer.doWork();

		System.out.println(computer.getSetting());

	}

}
